package nl.jjsoft.airlock
{
	import flash.utils.ByteArray;
	
	public class CryptoHelper
	{
		private var rijndael:Rijndael;
		private var key:String;
		private const mode:String = "CBC";
		
		public function CryptoHelper(key:String){
			this.rijndael = new Rijndael();
			this.key = key;
		}
		
		public function encrypt(data:String):String {							
			return rijndael.encrypt(data, key, mode);
		}
		
		public function decrypt(data:String):String {
			return rijndael.decrypt(data, key, mode);	
		}			

	}
}